const { ipcRenderer } = require("electron")

document.addEventListener('DOMContentLoaded', () => {
  const button = document.getElementById('button')
  button.addEventListener('click', () => {
    ipcRenderer.send('showMenu')
  })

  ipcRenderer.on('changeBold', () => {
    button.style.fontWeight = 'bold'
  })
  ipcRenderer.on('changeColor', () => {
    button.style.color = '#f60'
  })
})
document.addEventListener('mousedown', (e) => {
  if (e.button === 2) {
    ipcRenderer.invoke('mouseRight')
  }
})